<template>
  <div class="order_map">
    <ts-header title="地址" back></ts-header>
    <flex-view>
      <div ref="orderMap">
        <object type="text/html" :data="amap" width="100%" height="100%"></object>
      </div>
    </flex-view>
  </div>
</template>

<script>
  import {amapKey} from '../../assets/js/init'

  export default {
    name: 'order_map',
    data() {
      return {
        amap: ''
      }
    },
    mounted() {
      if (this.$route.query) {
        const {start, dest, destName} = this.$route.query;
//        console.log(start, dest, destName);
        this.amap = `http://m.amap.com/navi/?start=${start}&dest=${dest}&destName=${destName}&naviBy=car&key=${amapKey}`;
      }
    }
  }
</script>
